package org.lc.stk.web.dto.majorcengci;

import java.time.LocalDateTime;

import org.lc.stk.model.baseInfo.MajorCengci;

import com.fasterxml.jackson.annotation.JsonFormat;

import io.swagger.v3.oas.annotations.media.Schema;

@Schema(description = "专业层次关联响应")
public class MajorCengciResponse {
    
    @Schema(description = "专业层次关联ID", example = "1")
    private Integer id;
    
    @Schema(description = "专业ID", example = "1")
    private Integer majorId;
    
    @Schema(description = "专业编码", example = "CS")
    private String majorCode;
    
    @Schema(description = "专业名称", example = "计算机科学与技术")
    private String majorName;
    
    @Schema(description = "培养层次ID", example = "1")
    private Integer cengciId;
    
    @Schema(description = "培养层次编码", example = "BK")
    private String cengciCode;
    
    @Schema(description = "培养层次名称", example = "本科")
    private String cengciName;
    
    @Schema(description = "排序号", example = "1")
    private Integer orderNum;
    
    @Schema(description = "备注", example = "本科专业")
    private String remark;
    
    @Schema(description = "创建时间", example = "2025-02-11 16:00:00")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;
    
    @Schema(description = "更新时间", example = "2025-02-11 16:00:00")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateTime;

    public static MajorCengciResponse fromEntity(MajorCengci entity) {
        if (entity == null) {
            return null;
        }
        
        MajorCengciResponse response = new MajorCengciResponse();
        response.setId(entity.getId());
        response.setMajorId(entity.getMajor().getId());
        response.setMajorCode(entity.getMajor().getCode());
        response.setMajorName(entity.getMajor().getName());
        response.setCengciId(entity.getCengci().getId());
        response.setCengciCode(entity.getCengci().getCode());
        response.setCengciName(entity.getCengci().getName());
        response.setOrderNum(entity.getOrderNum());
        response.setRemark(entity.getRemark());
        response.setCreateTime(entity.getCreateTime());
        response.setUpdateTime(entity.getUpdateTime());
        return response;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getMajorId() {
        return majorId;
    }

    public void setMajorId(Integer majorId) {
        this.majorId = majorId;
    }

    public String getMajorCode() {
        return majorCode;
    }

    public void setMajorCode(String majorCode) {
        this.majorCode = majorCode;
    }

    public String getMajorName() {
        return majorName;
    }

    public void setMajorName(String majorName) {
        this.majorName = majorName;
    }

    public Integer getCengciId() {
        return cengciId;
    }

    public void setCengciId(Integer cengciId) {
        this.cengciId = cengciId;
    }

    public String getCengciCode() {
        return cengciCode;
    }

    public void setCengciCode(String cengciCode) {
        this.cengciCode = cengciCode;
    }

    public String getCengciName() {
        return cengciName;
    }

    public void setCengciName(String cengciName) {
        this.cengciName = cengciName;
    }

    public Integer getOrderNum() {
        return orderNum;
    }

    public void setOrderNum(Integer orderNum) {
        this.orderNum = orderNum;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public LocalDateTime getCreateTime() {
        return createTime;
    }

    public void setCreateTime(LocalDateTime createTime) {
        this.createTime = createTime;
    }

    public LocalDateTime getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(LocalDateTime updateTime) {
        this.updateTime = updateTime;
    }
}